package com.xjrh.traintravel.collector.netty.command.data;

import com.xjrh.traintravel.collector.netty.command.BaseCommand;

import java.io.Serializable;

/**
 * 采集数据-文件名
 *
 * @author snps
 * @create 2022-02-12 14:33
 * @describe
 **/
public class DataFileName extends BaseCommand implements Serializable {

    private static final long serialVersionUID = -3752034197725422058L;


    /**
     * 文件类型
     *      1-振动
     *      2-波磨
     *      3-温度
     */
    private int fileType;

    /**
     * 时间（年月日时分）
     */
    private String time;

    /**
     * 转向架（转向架对应主机的通讯口）
     *      转向架1-COM1：1
     *      转向架2-COM2：2
     */
    private int com;

    /**
     * 前置类型
     *      I型前置：1
     *      II型前置：2
     */
    private int frontType;

    /**
     * 前置通道（对应传感器）
     */
    private int frontAccess;

    /**
     * 环境温度
     */
    private int temperature;

    /**
     * 原始文件存储位置
     */
    private String originalFilePath;

    /** 数据采集日期 */
    private String collectionDate;


    /**
     * 获取文件名
     */
    public String getDataFileName() {
        return new StringBuilder()
                .append(this.getTime()).append("-")
                .append(this.getCom()).append(this.getFrontType()).append(this.getFrontAccess()).append("-")
                .append(this.getFileType()).append("-")
                .append(this.getTemperature())
                .toString();
    }


    /*****************************************
     * Getter and Setter
     */
    public int getFileType() {
        return fileType;
    }

    public void setFileType(int fileType) {
        this.fileType = fileType;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getCom() {
        return com;
    }

    public void setCom(int com) {
        this.com = com;
    }

    public int getFrontType() {
        return frontType;
    }

    public void setFrontType(int frontType) {
        this.frontType = frontType;
    }

    public int getFrontAccess() {
        return frontAccess;
    }

    public void setFrontAccess(int frontAccess) {
        this.frontAccess = frontAccess;
    }

    public int getTemperature() {
        return temperature;
    }

    public void setTemperature(int temperature) {
        this.temperature = temperature;
    }

    public String getOriginalFilePath() {
        return originalFilePath;
    }

    public void setOriginalFilePath(String originalFilePath) {
        this.originalFilePath = originalFilePath;
    }

    public String getCollectionDate() {
        return collectionDate;
    }

    public void setCollectionDate(String collectionDate) {
        this.collectionDate = collectionDate;
    }

    @Override
    public String toString() {
        return "DataFileName{" +
                "fileType=" + fileType +
                ", time='" + time + '\'' +
                ", com=" + com +
                ", frontType=" + frontType +
                ", frontAccess=" + frontAccess +
                ", temperature=" + temperature +
                ", originalFilePath='" + originalFilePath + '\'' +
                '}';
    }

}